<?php

/**
 * CategoriaAguaXPeridodo filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseCategoriaAguaXPeridodoFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'tipo_valor'        => new sfWidgetFormChoice(array('choices' => array('' => '', 'MTS3' => 'MTS3', 'CUOTA' => 'CUOTA'))),
      'valor'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'interes'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'categoria_agua_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CategoriaAgua'), 'add_empty' => true)),
      'periodo_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Periodo'), 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'tipo_valor'        => new sfValidatorChoice(array('required' => false, 'choices' => array('MTS3' => 'MTS3', 'CUOTA' => 'CUOTA'))),
      'valor'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'interes'           => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'categoria_agua_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('CategoriaAgua'), 'column' => 'id')),
      'periodo_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Periodo'), 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('categoria_agua_x_peridodo_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'CategoriaAguaXPeridodo';
  }

  public function getFields()
  {
    return array(
      'id'                => 'Number',
      'tipo_valor'        => 'Enum',
      'valor'             => 'Number',
      'interes'           => 'Number',
      'categoria_agua_id' => 'ForeignKey',
      'periodo_id'        => 'ForeignKey',
    );
  }
}
